package com.example.utils;

import android.graphics.Color;
import android.view.View;

import com.example.bean.CMinute;
import com.example.bean.StickData;
import com.example.mykline.R;


/**
 * Created by Administrator on 2016/8/25.
 */
public class ColorUtil2 {
    //滑动时底部时间价格背景颜色
    public static final int COLOR_SHIZHI_TIME_BACK= 0xff8893B0;
    //滑动时左边时间价格文本颜色
    public static final int COLOR_SHIZHI_TIME= 0xffffffff;
    //资金超大单线颜色
    public static final int COLOR_ZJ_SUPER = Color.parseColor("#FF9966");
    //资金大单线颜色
    public static final int COLOR_ZJ_BIG = Color.parseColor("#FF0000");
    //资金中单线颜色
    public static final int COLOR_ZJ_MIDDLE = Color.parseColor("#999900");
    //资金超小线颜色
    public static final int COLOR_ZJ_SMALL = Color.parseColor("#0099FF");
    //跌颜色
    public static  int COLOR_GREEN = 0xff41C957;
    //涨颜色
    public static  int COLOR_RED = 0xffFF3347;
    //平灰
    public static final int COLOR_PING_ASH = Color.parseColor("#333333");
    //平白
    public static final int COLOR_PING_WHITE = Color.parseColor("#efefef");
    //5均线颜色
    public static final int COLOR_SMA5 = 0xff9853EB;
    //10均线颜色
    public static final int COLOR_SMA10 = 0xff7498F8;
    //20均线颜色
    public static final int COLOR_SMA20 = 0xff57D9AC;
    //20均线颜色
    public static final int COLOR_SMA30 = 0xffF2A525;
    //MACD指标DIF颜色
    public static final int COLOR_DIF = Color.parseColor("#85d6f0");
    //MACD指标DEA颜色
    public static final int COLOR_DEA = Color.parseColor("#fea044");
    //MACD指标MACD字体颜色
    public static final int COLOR_MACD = Color.parseColor("#e27bda");
    //KDJ指标K颜色
    public static final int COLOR_KDJ_K = COLOR_DIF;
    //KDJ指标D颜色
    public static final int COLOR_KDJ_D = COLOR_DEA;
    //KDJ指标J颜色
    public static final int COLOR_KDJ_J = Color.parseColor("#e27bda");

    //分时线价格颜色
    public static final int COLOR_PRICE_LINE = Color.parseColor("#7498F8");
    //分时线均线颜色
    public static final int COLOR_SMA_LINE = Color.parseColor("#F2A525");
    /**
     * 滑动时十字线的颜色
     */
    public static final int COLOR_CROSS_LINE = Color.parseColor("#2e68b2");
    /**
     * 1红涨绿跌 2绿涨红跌
     */
    private static int type=1;
    /**
     * 1白天 2黑色
     */
    private static int zhuti=1;
   View view;
   public ColorUtil2(View view)
   {
       this.view=view;
   }
   public int getBackColor()
   {
       return view.getResources().getColor(R.color.color_back1);
   }
    public int getTextColor1()
    {
        //return view.getResources().getColor(R.color.color_text1);
        if(zhuti==1)
        {
            return 0xff5A5A5A;
        }
        else
        {
            return 0xffB9C1D3;
        }
    }
    public int getTextColor2()
    {
        //return view.getResources().getColor(R.color.color_text2);
        if(zhuti==1)
        {
            return 0xff455987;
        }
        else
        {
            return 0xff8893B0;
        }
    }
    public int getTextColor3()
    {
        return view.getResources().getColor(R.color.color_text3);
    }
    public int getTextColor4()
    {
        return view.getResources().getColor(R.color.color_text4);
    }
    public int getTextColor7()
    {
        //return view.getResources().getColor(R.color.color_text7);
        if(zhuti==1)
        {
            return 0xff455987;
        }
        else
        {
            return 0xffffffff;
        }
    }
    /**
     * 得到上涨的颜色
     * @return
     */
    public int getUpcolor()
    {
        if(type==1) {
            return view.getResources().getColor(R.color.color_up);
        }
        else
        {
            return view.getResources().getColor(R.color.color_down);
        }
    }
    /**
     * 得到下跌的颜色
     * @return
     */
    public int getDowncolor()
    {
        if(type==2) {
            return view.getResources().getColor(R.color.color_up);
        }
        else
        {
            return view.getResources().getColor(R.color.color_down);
        }
    }
    /**
     *
     * @return
     */
    public static int getPingcolor()
    {
        if(zhuti==1) {
            return 0xff101010;
        }
        else
        {
            return 0xffd8dde8;
        }
    }
    public int getGridcolor()
    {
        //return view.getResources().getColor(R.color.color_grid);

        if(zhuti==1)
        {
            return 0xffE6EBF1;
        }
        else
        {
            return 0xff282b33;
        }
    }

    /**
     * 得到阴影的颜色
     * @return
     */
    public int getYinYincolor()
    {
        return view.getResources().getColor(R.color.color_yinyin);
    }
    /**
     * 得到阴影线的颜色
     * @return
     */
    public int getYinYincolor2()
    {
        //return view.getResources().getColor(R.color.color_yinyin2);
        if(zhuti==1)
        {
            return 0x804385f3;
        }
        else
        {
            return 0x80ACC9FC;
        }
    }

    /**
     * 得到十字线的颜色
     * @return
     */
    public int getCrosLinecolor()
    {
       // return view.getResources().getColor(R.color.color_cross_line);
        if(zhuti==1)
        {
            return 0xff2e68b2;
        }
        else
        {
            return 0xffD8DDE8;
        }
    }
    /**
     * 得到十字线的颜色
     * @return
     */
    public int getCrosBackcolor()
    {
        //return view.getResources().getColor(R.color.color_cross_back);
        if(zhuti==1)
        {
            return 0xff8893B0;
        }
        else
        {
            return 0xff4B4F59;
        }
    }
    /**
     * 得到十字线的颜色
     * @return
     */
    public int getCrosTextcolor()
    {
        //return view.getResources().getColor(R.color.color_cross_text);
        if(zhuti==1)
        {
            return 0xffffffff;
        }
        else
        {
            return 0xffFFFFFF;
        }
    }
    public static int getType() {
        return type;
    }

    public static void setType(int type) {
        ColorUtil2.type = type;
    }
    public static void setZhuTi(int zhuti) {
        ColorUtil2.zhuti=zhuti;
    }
}
